CryptConst(name)
{
ALG_CLASS_ANY := (0)
ALG_CLASS_SIGNATURE := (1 << 13)
ALG_CLASS_MSG_ENCRYPT := (2 << 13)
ALG_CLASS_DATA_ENCRYPT := (3 << 13)
ALG_CLASS_HASH := (4 << 13)
ALG_CLASS_KEY_EXCHANGE := (5 << 13)
ALG_CLASS_ALL := (7 << 13)
ALG_TYPE_ANY := (0)
ALG_TYPE_DSS := (1 << 9)
ALG_TYPE_RSA := (2 << 9)
ALG_TYPE_BLOCK := (3 << 9)
ALG_TYPE_STREAM := (4 << 9)
ALG_TYPE_DH := (5 << 9)
ALG_TYPE_SECURECHANNEL := (6 << 9)
ALG_SID_ANY := (0)
ALG_SID_RSA_ANY := 0
ALG_SID_RSA_PKCS := 1
ALG_SID_RSA_MSATWORK := 2
ALG_SID_RSA_ENTRUST := 3
ALG_SID_RSA_PGP := 4
ALG_SID_DSS_ANY := 0
ALG_SID_DSS_PKCS := 1
ALG_SID_DSS_DMS := 2
ALG_SID_ECDSA := 3
ALG_SID_DES := 1
ALG_SID_3DES := 3
ALG_SID_DESX := 4
ALG_SID_IDEA := 5
ALG_SID_CAST := 6
ALG_SID_SAFERSK64 := 7
ALG_SID_SAFERSK128 := 8
ALG_SID_3DES_112 := 9
ALG_SID_CYLINK_MEK := 12
ALG_SID_RC5 := 13
ALG_SID_AES_128 := 14
ALG_SID_AES_192 := 15
ALG_SID_AES_256 := 16
ALG_SID_AES := 17
ALG_SID_SKIPJACK := 10
ALG_SID_TEK := 11
CRYPT_MODE_CBCI := 6       ; ANSI CBC Interleaved
CRYPT_MODE_CFBP := 7       ; ANSI CFB Pipelined
CRYPT_MODE_OFBP := 8       ; ANSI OFB Pipelined
CRYPT_MODE_CBCOFM := 9       ; ANSI CBC + OF Masking
CRYPT_MODE_CBCOFMI := 10      ; ANSI CBC + OFM Interleaved
ALG_SID_RC2 := 2
ALG_SID_RC4 := 1
ALG_SID_SEAL := 2
ALG_SID_DH_SANDF := 1
ALG_SID_DH_EPHEM := 2
ALG_SID_AGREED_KEY_ANY := 3
ALG_SID_KEA := 4
ALG_SID_ECDH := 5
ALG_SID_MD2 := 1
ALG_SID_MD4 := 2
ALG_SID_MD5 := 3
ALG_SID_SHA := 4
ALG_SID_SHA1 := 4
ALG_SID_MAC := 5
ALG_SID_RIPEMD := 6
ALG_SID_RIPEMD160 := 7
ALG_SID_SSL3SHAMD5 := 8
ALG_SID_HMAC := 9
ALG_SID_TLS1PRF := 10
ALG_SID_HASH_REPLACE_OWF := 11
ALG_SID_SHA_256 := 12
ALG_SID_SHA_384 := 13
ALG_SID_SHA_512 := 14
ALG_SID_SSL3_MASTER := 1
ALG_SID_SCHANNEL_MASTER_HASH := 2
ALG_SID_SCHANNEL_MAC_KEY := 3
ALG_SID_PCT1_MASTER := 4
ALG_SID_SSL2_MASTER := 5
ALG_SID_TLS1_MASTER := 6
ALG_SID_SCHANNEL_ENC_KEY := 7
ALG_SID_ECMQV := 1
ALG_SID_EXAMPLE := 80
CALG_MD2 := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
CALG_MD4 := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
CALG_MD5 := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
CALG_SHA := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
CALG_SHA1 := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1)
CALG_MAC := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
CALG_RSA_SIGN := (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
CALG_DSS_SIGN := (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
CALG_NO_SIGN := (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY)
CALG_RSA_KEYX := (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_RSA|ALG_SID_RSA_ANY)
CALG_DES := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DES)
CALG_3DES_112 := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3DES_112)
CALG_3DES := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3DES)
CALG_DESX := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DESX)
CALG_RC2 := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_RC2)
CALG_RC4 := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_RC4)
CALG_SEAL := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_SEA)
CALG_DH_SF := (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_SANDF)
CALG_DH_EPHEM := (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_EPHEM)
CALG_AGREEDKEY_ANY := (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_AGREED_KEY_ANY)
CALG_KEA_KEYX := (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_KEA)
CALG_HUGHES_MD5 := (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_ANY|ALG_SID_MD5)
CALG_SKIPJACK := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_SKIPJACK)
CALG_TEK := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_TEK)
CALG_CYLINK_MEK := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_CYLINK_MEK)
CALG_SSL3_SHAMD5 := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
CALG_SSL3_MASTER := (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SSL3_MASTER)
CALG_SCHANNEL_MASTER_HASH := (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_MASTER_HASH)
CALG_SCHANNEL_MAC_KEY := (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_MAC_KEY)
CALG_SCHANNEL_ENC_KEY := (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_ENC_KEY)
CALG_PCT1_MASTER := (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_PCT1_MASTER)
CALG_SSL2_MASTER := (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SSL2_MASTER)
CALG_TLS1_MASTER := (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_TLS1_MASTER)
CALG_RC5 := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_RC5)
CALG_HMAC := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
CALG_TLS1PRF := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF)
CALG_HASH_REPLACE_OWF := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF)
CALG_AES_128 := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_128)
CALG_AES_192 := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_192)
CALG_AES_256 := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_256)
CALG_AES := (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES)
CALG_SHA_256 := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256)
CALG_SHA_384 := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384)
CALG_SHA_512 := (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512)
CALG_ECDH := (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_ECDH)
CALG_ECMQV := (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_ECMQV)
CALG_ECDSA := (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_ECDSA)
CRYPT_VERIFYCONTEXT := 0xF0000000
CRYPT_NEWKEYSET := 0x00000008
CRYPT_DELETEKEYSET := 0x00000010
CRYPT_MACHINE_KEYSET := 0x00000020
CRYPT_SILENT := 0x00000040
CRYPT_DEFAULT_CONTAINER_OPTIONAL := 0x00000080
CRYPT_EXPORTABLE := 0x00000001
CRYPT_USER_PROTECTED := 0x00000002
CRYPT_CREATE_SALT := 0x00000004
CRYPT_UPDATE_KEY := 0x00000008
CRYPT_NO_SALT := 0x00000010
CRYPT_PREGEN := 0x00000040
CRYPT_RECIPIENT := 0x00000010
CRYPT_INITIATOR := 0x00000040
CRYPT_ONLINE := 0x00000080
CRYPT_SF := 0x00000100
CRYPT_CREATE_IV := 0x00000200
CRYPT_KEK := 0x00000400
CRYPT_DATA_KEY := 0x00000800
CRYPT_VOLATILE := 0x00001000
CRYPT_SGCKEY := 0x00002000
CRYPT_ARCHIVABLE := 0x00004000
CRYPT_FORCE_KEY_PROTECTION_HIGH := 0x00008000
RSA1024BIT_KEY := 0x04000000
CRYPT_SERVER := 0x00000400
KEY_LENGTH_MASK := 0xFFFF0000
CRYPT_Y_ONLY := 0x00000001
CRYPT_SSL2_FALLBACK := 0x00000002
CRYPT_DESTROYKEY := 0x00000004
CRYPT_OAEP := 0x00000040  ; used with RSA encryptions/decryptions
CRYPT_BLOB_VER3 := 0x00000080  ; export version 3 of a blob type
CRYPT_IPSEC_HMAC_KEY := 0x00000100  ; CryptImportKey only
CRYPT_DECRYPT_RSA_NO_PADDING_CHECK := 0x00000020
CRYPT_SECRETDIGEST := 0x00000001
CRYPT_OWF_REPL_LM_HASH := 0x00000001  ; this is only for the OWF replacement CSP
CRYPT_LITTLE_ENDIAN := 0x00000001
CRYPT_NOHASHOID := 0x00000001
CRYPT_TYPE2_FORMAT := 0x00000002
CRYPT_X931_FORMAT := 0x00000004
CRYPT_MACHINE_DEFAULT := 0x00000001
CRYPT_USER_DEFAULT := 0x00000002
CRYPT_DELETE_DEFAULT := 0x00000004
SIMPLEBLOB := 0x1
PUBLICKEYBLOB := 0x6
PRIVATEKEYBLOB := 0x7
PLAINTEXTKEYBLOB := 0x8
OPAQUEKEYBLOB := 0x9
PUBLICKEYBLOBEX := 0xA
SYMMETRICWRAPKEYBLOB := 0xB
KEYSTATEBLOB := 0xC
AT_KEYEXCHANGE := 1
AT_SIGNATURE := 2
CRYPT_USERDATA := 1
KP_IV := 1       ; Initialization vector
KP_SALT := 2       ; Salt value
KP_PADDING := 3       ; Padding values
KP_MODE := 4       ; Mode of the cipher
KP_MODE_BITS := 5       ; Number of bits to feedback
KP_PERMISSIONS := 6       ; Key permissions DWORD
KP_ALGID := 7       ; Key algorithm
KP_BLOCKLEN := 8       ; Block size of the cipher
KP_KEYLEN := 9       ; Length of key in bits
KP_SALT_EX := 10      ; Length of salt in bytes
KP_P := 11      ; DSS/Diffie-Hellman P value
KP_G := 12      ; DSS/Diffie-Hellman G value
KP_Q := 13      ; DSS Q value
KP_X := 14      ; Diffie-Hellman X value
KP_Y := 15      ; Y value
KP_RA := 16      ; Fortezza RA value
KP_RB := 17      ; Fortezza RB value
KP_INFO := 18      ; for putting information into an RSA envelope
KP_EFFECTIVE_KEYLEN := 19      ; setting and getting RC2 effective key length
KP_SCHANNEL_ALG := 20      ; for setting the Secure Channel algorithms
KP_CLIENT_RANDOM := 21      ; for setting the Secure Channel client random data
KP_SERVER_RANDOM := 22      ; for setting the Secure Channel server random data
KP_RP := 23
KP_PRECOMP_MD5 := 24
KP_PRECOMP_SHA := 25
KP_CERTIFICATE := 26      ; for setting Secure Channel certificate data (PCT1)
KP_CLEAR_KEY := 27      ; for setting Secure Channel clear key data (PCT1)
KP_PUB_EX_LEN := 28
KP_PUB_EX_VAL := 29
KP_KEYVAL := 30
KP_ADMIN_PIN := 31
KP_KEYEXCHANGE_PIN := 32
KP_SIGNATURE_PIN := 33
KP_PREHASH := 34
KP_ROUNDS := 35
KP_OAEP_PARAMS := 36      ; for setting OAEP params on RSA keys
KP_CMS_KEY_INFO := 37
KP_CMS_DH_KEY_INFO := 38
KP_PUB_PARAMS := 39      ; for setting public parameters
KP_VERIFY_PARAMS := 40      ; for verifying DSA and DH parameters
KP_HIGHEST_VERSION := 41      ; for TLS protocol version setting
KP_GET_USE_COUNT := 42      ; for use with PP_CRYPT_COUNT_KEY_USE contexts
KP_PIN_ID := 43
KP_PIN_INFO := 44
HP_ALGID := 0x0001  ; Hash algorithm
HP_HASHVAL := 0x0002  ; Hash value
HP_HASHSIZE := 0x0004  ; Hash value size
HP_HMAC_INFO := 0x0005  ; information for creating an HMAC
HP_TLS1PRF_LABEL := 0x0006  ; label for TLS1 PRF
HP_TLS1PRF_SEED := 0x0007  ; seed for TLS1 PRF
PROV_RSA_FULL := 1
PROV_RSA_SIG := 2
PROV_DSS := 3
PROV_FORTEZZA := 4
PROV_MS_EXCHANGE := 5
PROV_SSL := 6
PROV_RSA_SCHANNEL := 12
PROV_DSS_DH := 13
PROV_EC_ECDSA_SIG := 14
PROV_EC_ECNRA_SIG := 15
PROV_EC_ECDSA_FULL := 16
PROV_EC_ECNRA_FULL := 17
PROV_DH_SCHANNEL := 18
PROV_SPYRUS_LYNKS := 20
PROV_RNG := 21
PROV_INTEL_SEC := 22
PROV_REPLACE_OWF := 23
PROV_RSA_AES := 24
PROV_STT_MER := 7
PROV_STT_ACQ := 8
PROV_STT_BRND := 9
PROV_STT_ROOT := 10
PROV_STT_ISS := 11
StringReplace,name,name,`n,`,,1				;replacing new lines with comma
	IfInString, name,,
	{
		arr := {}
		StringSplit,const,name,`,,%A_TAB%%A_SPACE%`n
		loop,%const0%
		{
			v := const%A_Index%
			if !v
				continue
			arr[v] := %v%
		}
		return arr
	}
	else
	{
		p := %name%
		if (p = "")
			p = err
		return p
	}
}